#!/usr/local/bin/perl
# Copyright (c) 2000-2006 ActiveState Software Inc.
# See the file LICENSE.txt for licensing information.


Import(
    "cons",
    "mozChromeDir",
    "supportDir",
    "platform",
    "unsiloedPythonExe",
    "productType",
    "buildFlavour",
    "mozVersion",
);

my $supportSampleDir = "$supportDir/samples/tools";

for my $dir ('Abbreviations', 'HTML', 'Sample_Macros', 'File Templates') {
    $cons->InstallRecursive("$supportSampleDir/$dir", 
                        #XXX must be absolute path (bug in InstallRecursive)
			    cwd() . "/src/samples/tools/$dir",
                            ('\.consign', '\.svn'));
}
for my $file (qw/
                http_stackoverflow_com_.ktf
                Open_New_Window.ktf
                Sample_Snippet_-_Double_Click_to_Insert.ktf
                toggle-word-wrap-edit.ktf
/) {
    $cons->InstallWriteable($supportSampleDir, $file);
}

if ($platform eq 'win') {
    for my $file (qw/Perldoc_on_selection_for_builtin.ktf
                Perldoc_on_selection_for_modules_.ktf
                Start_Browser.ktf
                pod2html_current_file.ktf/) {
        $cons->InstallWriteable($supportSampleDir, $file);
    }
    # These files differ for Windows and others
    for my $file (qw/
                Find_in_Files.ktf
                Make_current_file_writeable.ktf/) {
	$cons->Preprocess("${file}.win", $file);
	$cons->InstallWriteable($supportSampleDir, $file);
    }
} else {
    for my $file (qw/Count_words_in_selection_using_wc_.ktf/) {
        $cons->InstallWriteable($supportSampleDir, $file);
    }
    for my $file (qw/
                Find_in_Files.ktf
                Make_current_file_writeable.ktf/) {
	$cons->Preprocess("${file}.std", $file);
	$cons->InstallWriteable($supportSampleDir, $file);
    }
}
